						<div class="heading">

							<h3>Logger</h3>                    

							<div class="resBtnSearch">
								<a href="#"><span class="icon16 icomoon-icon-search-3"></span></a>
							</div>
							
							<ul class="breadcrumb">
								<li>Anda berada di:</li>
								<li>
									<a href="#" class="tip" title="back to dashboard">
										<span class="icon16 icomoon-icon-screen-2"></span>
									</a> 
									<span class="divider">
										<span class="icon16 icomoon-icon-arrow-right-2"></span>
									</span>
								</li>
								<li>
									Pengaturan 
									<span class="divider">
										<span class="icon16 icomoon-icon-arrow-right-2"></span>
									</span>
								</li>
								<li class="active">Logger</li>
							</ul>

						</div><!-- End .heading-->

						<!-- Build page from here: -->
						<div class="row-fluid">

							<div class="span12">
								<div class="centerContent">
									<div class="box">

										<div class="title">
											<h4>
												<span class="icon16 icomoon-icon-grid"></span>
												<span>Log Aktivitas (reload dalam waktu <span id="timer-label">60</span> detik)</span>
											</h4>
										</div>
										
										<div class="content">
											<form id="search" class="form-vertical" action="" method="post">
												<div class="form-row row-fluid">
													<div class="span6">
														<div class="span12">
															<div class="span5 controls">
																<input type="text" name="date_a" id="date_a" class="date" value="<?php echo $date_a ?>" />
															</div>
															<div class="span1 input-append" style="margin-right:10px;">
																<span class="add-on">s/d</span>
															</div>
															<div class="span5 controls">
																<input type="text" name="date_b" id="date_b" class="date" value="<?php echo $date_b ?>" />
															</div>
														</div>
													</div>
													<div class="span3">
														<input type="text" name="q" id='q' value="<?php echo $q ?>" class="searchField" placeholder="filter ..." style="max-width: 100% !important;"/>
													</div>
													<div class="span3">
														<div class="span6 controls">   
															<select name="page" onChange="$('#search').submit()">
																<?php
																	$total = $log['count']->num_rows();
																	$totpage=0;
																	if(($total%$limit) == 0)
																		$totpage=$total/$limit;
																	else
																		$totpage=(int)($total/$limit) + 1;
																	
																	for($i=1;$i<=$totpage;$i++){
																		echo "<option value='$i' ".($i == $page?'selected="selected"':'')." >$i</option>";
																	}
																?>
															</select>
														</div> 
														<button type="submit" class="btn btn-primary">LIHAT</button>
													</div>
												</div>
											</form>
											
											<table class="responsive table table-striped table-bordered table-condensed">
												<thead>
													<tr>
														<tr>
															<th align="center">TIME</th>
															<th align="center">REG</th>
															<th align="center">USER</th>
															<th align="center">ACTIVITY</th>
															<th align="center">INFORMATION</th>
															<th align="center">IP ADDRESS</th>
														</tr>
													</tr>
												</thead>
												<tbody>
												<?php
													foreach($log['data']->result_array() as $row){
														echo "<tr>";
														echo "<td>$row[time]</td>";
														echo "<td>".($row['id_agent'] != ""?$row['id_agent']:$row['id_employer'])."</td>";
														echo "<td>$row[name]</td>";
														echo "<td>$row[activity]</td>";
														echo "<td>$row[information]</td>";
														echo "<td>$row[ip_address]</td>";
														echo "</tr>";
													}
													if($log['data']->num_rows() == 0){
														echo "<tr>";
														echo "<td align='center' colspan=5><i>Data not found</i></td>";
														echo "</tr>";
													}
												?>						
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div><!-- End .span8 -->

						</div><!-- End .row-fluid -->
						
						<script>
							$(document).ready(function(){
								var countdown;
								var count=60;
								countdown = setInterval(function(){
									$("#timer-label").html(count);
									if(count == 0){
										$("form#search").submit();
									}
									count--;
								}, 1000);
							})
						</script>